<?php 
include 'top1.php';
include '../connect.php';
?>
<?php 
include 'left.php';
?>
<div class="ny-right">
<div class="ny-zjhz">
  <h3>修改信息</h3>
  <div class="grjl">
  <div id="twjs">



<?php 


if ($_GET['action']=='edit'){
 	$query= mysql_query("update course set number = '{$_POST['number']}',course = '{$_POST['course']}',name = '{$_POST['name']}',count = '{$_POST['count']}' where id = ".$_GET['id']) or die(mysql_error());
	echo "<script type='text/javascript'>alert('修改成功');window.location.href='admin_mark.php';</script>";

}

$_query = mysql_query("select * from course where id = ".$_GET['id']);
$_rows = mysql_fetch_array($_query,MYSQL_ASSOC);


 ?>


  
  <form action="?action=edit&id=<?php echo $_GET['id'];?>" method="post"  >
            <table  >
                <tr>
                    <td height="28"> 课程编号：</td>
                    <td><input type="text" name="number" size="30"  value="<?php echo $_rows['number'];?>"/></td>
                </tr>
				
                <tr>
                    <td height="28"> 课程名：</td>
                    <td><input type="text" name="course" size="30"  value="<?php echo $_rows['course'];?>"/></td>
                </tr>
				  <tr>
                    <td height="28"> 学院名：</td>
                    <td><input type="text" name="name" size="30"  value="<?php echo $_rows['name'];?>"/></td>
                </tr>
            
                <tr>
                    <td height="28"> 学生人数：</td>
                    <td><input type="text" name="count" size="30"  value="<?php echo $_rows['count'];?>"/></td>
                </tr>
			
                    
               
           
               
              
                <tr>
                    <td colspan="2" style="text-align:center;">
                        <input type="submit" name="submit" value="修改" />
                    </td>
                </tr>
            </table>
        </form>
  

</div>

   </div>
 
</div>

</div>

<div class="clear"></div>
</div>


<?php 
include 'foot.php';

?>
